<template>
    <view style="height: 100%">
        <!-- template/toasts/toasts.wxml -->
        <!-- 显示弹框，要把div的css设置为opacity:1;pointer-events:auto; -->
        <!-- 联系人信息弹框 -->
        <template name="actmainLink">
            <view class="code-succeed" v-if="linkmainHe" style="opacity: 1; pointer-events: auto">
                <view class="code-succeed-toast code-club-position">
                    <image src="/static/images/close1@2x.png" class="code-close" @tap="closemainLink"></image>
                    <view class="activity-link-theme">您可以通过{{ adcontactWay }}与{{ adminname }}取得联系</view>
                    <view class="activity-flex-wap">
                        <image v-if="adcontactWay == '微信号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/wx.png"></image>
                        <image v-if="adcontactWay == '手机号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/phone.png"></image>
                        <image v-if="adcontactWay == 'QQ号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/qq.png"></image>
                        <view class="activity-link-txt">{{ adcontactValue }}</view>
                    </view>
                    <view class="activity-link-btn">
                        <view class="activity-link-button" @tap="copyLink" :data-value="adcontactValue">复制Ta的{{ adcontactWay }}</view>
                    </view>
                </view>
            </view>
        </template>
        <!-- 加入人信息弹框 -->
        <template name="actjoinLink">
            <view class="code-succeed" v-if="item.linkjoinHe" style="opacity: 1; pointer-events: auto">
                <view class="code-succeed-toast code-club-position">
                    <image src="/static/images/close1@2x.png" class="code-close" @tap="closejoinLink"></image>
                    <view class="activity-link-theme">您可以通过{{ item.contactWay }}与{{ item.realname }}取得联系</view>
                    <view class="activity-flex-wap">
                        <image v-if="item.contactWay == '微信号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/wx.png"></image>
                        <image v-if="item.contactWay == '手机号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/phone.png"></image>
                        <image v-if="item.contactWay == 'QQ号'" mode="widthFix" class="activity-link-img" src="/static/images/icon/qq.png"></image>
                        <view class="activity-link-txt">{{ item.contactValue }}</view>
                    </view>
                    <view class="activity-link-btn">
                        <view class="activity-link-button" @tap="copyLink" :data-value="item.contactValue">复制Ta的{{ item.contactWay }}</view>
                    </view>
                </view>
            </view>
        </template>

        <!-- 活动二维码弹框 -->
        <template name="actCode">
            <view class="code-succeed" v-if="codeHehe" style="opacity: 1; pointer-events: auto">
                <view class="code-succeed-toast">
                    <image src="/static/images/close1@2x.png" class="code-close" @tap="closeCode"></image>
                    <view class="code-club-content">
                        <view class="code-club-theme">邀请好友加入活动</view>
                        <view class="text-center text-space">方式一：点击右上角【...】－【分享】发送给好友，点击即可查看活动详情</view>
                        <view class="code-club-tip text-center">或</view>
                        <view class="text-space">方式二：分享下方二维码</view>
                        <view class="text-space">用微信扫一扫即可查看活动详情</view>
                    </view>
                    <view>
                        <image mode="widthFix" class="code-message-img" :src="'data:image/png;base64,' + imageBytes"></image>
                    </view>
                </view>
            </view>
        </template>

        <!-- 活动群二维码弹框 -->
        <template name="actQrCode">
            <view class="code-succeed" v-if="qrcodeHe" style="opacity: 1; pointer-events: auto">
                <view class="code-succeed-toast">
                    <image src="/static/images/close1@2x.png" class="code-close" @tap="closeqrcode"></image>
                    <view class="code-club-content">
                        <view class="code-club-theme">进入该发起的群聊</view>
                        <view class="text-space">由发起者创建，方便于大家的交流</view>
                        <view class="text-space">请点击二维码查看大图，长按保存，扫一扫加入</view>
                    </view>
                    <view>
                        <image mode="widthFix" class="code-message-img" :src="qrcode" @tap="seeqrCodeBig"></image>
                    </view>
                </view>
            </view>
        </template>
    </view>
</template>

<script>
// template/toasts/toasts.js
export default {
    data() {
        return {
            linkmainHe: '',
            adcontactWay: '',
            adminname: '',
            adcontactValue: '',
            codeHehe: '',
            imageBytes: '',
            qrcodeHe: '',
            qrcode: ''
        };
    },
    onLoad: function (options) {
        // 页面初始化 options为页面跳转所带来的参数
    },
    onReady: function () {
        // 页面渲染完成
    },
    onShow: function () {
        // 页面显示
    },
    onHide: function () {
        // 页面隐藏
    },
    onUnload: function () {
        // 页面关闭
    },
    methods: {}
};
</script>
<style>
/* template/toasts/toasts.wxss */

.page {
    white-space: normal;
}

.apply-succeed {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 400ms ease-in;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.apply-succeed-toast {
    width: 84%;
    background-color: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apply-succeed-image {
    width: 158rpx;
    height: 158rpx;
    margin: 50rpx auto 30rpx;
}

.apply-succeed-content {
    text-align: center;
    padding-bottom: 30rpx;
}

.apply-succeed-btn {
    position: relative;
    z-index: 100;
    width: 80%;
    color: #fff;
    background: #3dd1a5;
    margin-bottom: 40rpx;
}

/*活动二维码弹框*/
.code-succeed {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
    opacity: 0;
    transition: opacity 400ms ease-in;
    pointer-events: none;
}

.code-succeed-toast {
    position: relative;
    width: 80%;
    border-radius: 20rpx;
    background: #fff;
    margin: 7% 0 0 10%;
    padding-bottom: 66rpx;
    z-index: 100;
}

.code-club-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 30rpx 0;
    padding: 60rpx 0 36rpx;
    font-size: 28rpx;
}

.code-club-theme {
    font-size: 36rpx;
    color: #252525;
    font-weight: bold;
    margin-bottom: 41rpx;
}

.code-club-tip {
    width: 56rpx;
    height: 56rpx;
    border-radius: 50%;
    margin: 40rpx 0 30rpx;
    background: #3dd1a5;
    color: #fff;
    line-height: 56rpx;
}

.text-center {
    text-align: center;
}
.text-space {
    line-height: 48rpx;
    letter-spacing: -0.6rpx;
}
.code-message {
    margin: 30rpx auto 0;
}

.code-message-align {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code-message-logo {
    width: 100rpx;
    height: 100rpx;
    border-radius: 50%;
}

.code-message-icon {
    position: absolute;
    top: 75rpx;
    left: 50%;
    margin-left: 26rpx;
    width: 30rpx;
    height: 30rpx;
}

.code-content-title {
    text-align: center;
    padding: 20rpx 30rpx 10rpx;
}

.code-content-text {
    text-align: center;
    font-size: 24rpx;
}

.code-message-img {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 360rpx;
    border: 1rpx solid #e5e5e5;
}

.code-content-btn {
    width: 80%;
    background: #3dd1a5;
    color: #fff;
    margin-bottom: 30rpx;
}

.code-text {
    opacity: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14%;
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.code-club-position {
    margin-top: 28%;
}

.code-span {
    text-align: center;
    font-size: 30rpx;
    color: #b2b2b2;
    padding-bottom: 20rpx;
}

.code-close {
    position: absolute;
    top: 10rpx;
    right: 10rpx;
    width: 32rpx;
    height: 32rpx;
    padding: 20rpx;
}

/*联系信息弹窗*/
.activity-code-title {
    text-align: center;
    padding: 0 11%;
    font-size: 32rpx;
    font-weight: bold;
    color: #1a1a1a;
    line-height: 50rpx;
    letter-spacing: -0.8rpx;
}

.activity-link-theme {
    font-size: 30rpx;
    color: #252525;
    font-weight: bold;
    margin-bottom: 41rpx;
    margin: 0 30rpx;
    border-bottom: 1rpx solid rgb(230, 230, 230);
    padding-top: 86rpx;
    padding-bottom: 20rpx;
    line-height: 50rpx;
    letter-spacing: -0.6rpx;
    text-align: center;
}
.activity-flex-wap {
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.activity-link-txt {
    text-align: center;
    font-size: 34rpx;
    margin: 0 30rpx;
    color: #1a1a1a;
    font-weight: bold;
    padding-top: 50rpx;
    padding-bottom: 50rpx;
    line-height: 50rpx;
    letter-spacing: -0.6rpx;
}
.activity-link-img {
    width: 32px;
    padding-top: 50rpx;
    padding-bottom: 50rpx;
    text-align: center;
    margin: 0 30rpx;
    line-height: 50rpx;
    letter-spacing: -0.6rpx;
}
.activity-link-btn {
    background: #fff;
    overflow: hidden;
}
.activity-link-button {
    width: 500rpx;
    height: 80rpx;
    line-height: 80rpx;
    text-align: center;
    font-size: 16px;
    border: 0 none;
    background: #118fff;
    color: #fff;
    margin: 0 auto;
    border-radius: 10px;
}

.show-tips {
    position: fixed;
    top: 80%;
    left: 50%;
    width: 350rpx;
    margin-top: -40rpx;
    margin-left: -175rpx;
    border-radius: 10rpx;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15rpx 20rpx;
    font-size: 30rpx;
    line-height: 50rpx;
    white-space: wrap;
    color: white;
    text-align: center;
    display: none;
}
</style>
